package modex;

@SuppressWarnings("unchecked")
public class TermePara implements java.lang.Comparable {

	private int idTerme;
	private int idPara;
	private int poids;
	private String position;
	private float score;
	
	public TermePara() {}
	public TermePara(int idT, int idP, int pds, String pos) {
		this.idTerme = idT;
		this.idPara = idP;
		this.poids = pds;
		this.position = pos;
		this.score = new Float(0);
	}

	public TermePara(int idT, int idP, int pds, String pos, Float score) {
		this.idTerme = idT;
		this.idPara = idP;
		this.poids = pds;
		this.position = pos;
		this.score = score;
	}
	
	@Override
	public int compareTo(Object arg0) {
		float score1 = ((TermePara) arg0).getScore(); 
		float score2 = this.getScore(); 
		if (score1 > score2)  return -1; 
		else if(score1 == score2) return 0; 
		else return 1; 
	}
	
	public int getIdTerme() {
		return idTerme;
	}

	public void setIdTerme(int idTerme) {
		this.idTerme = idTerme;
	}

	public int getIdPara() {
		return idPara;
	}

	public void setIdPara(int idPara) {
		this.idPara = idPara;
	}

	public int getPoids() {
		return poids;
	}

	public void setPoids(int poids) {
		this.poids = poids;
	}

	public String getPosition() {
		return position;
	}

	public void setPosition(String position) {
		this.position = position;
	}
	public float getScore() {
		return score;
	}
	public void setScore(float score) {
		this.score = score;
	}
}
